<%@ include file="/other/Header.jsp" %>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>

<jsp:directive.page import="java.io.*"/>

<!--<jsp:directive.page import="com.oreilly.servlet.MultipartRequest"/>-->
<jsp:directive.page import="java.sql.*"/>
<jsp:directive.page import="Connectivity.ConnectionManager"/>
<!--<jsp:directive.page import="com.oreilly.*"/>-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Upload.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     <%-- This jsp Page is Uploding The Image into Database using MultipartRequest class
FileSystem concepts and ByteArray.
--%> 


<%

/* The Following Code is Used To Insert An Image Into Database */

//String filename="";
//try
//{
//Download com.oreilly package

//MultipartRequest multi= new MultipartRequest(request,".",5*1024*1024);
//Enumeration files=multi.getFileNames();
//File f=null;
//while(files.hasMoreElements())
//{
//String name=(String)files.nextElement();
//filename=multi.getFilesystemName(name);
//String type=multi.getContentType(name);
//f=multi.getFile(name);
//System.out.println("The File is "+f);
//}
//Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver;databasename="xxx","username","password");
//Statement stmt = con.createStatement();
//InputStream is = new FileInputStream(f);
//byte b[]=new byte[is.available()];
//is.read(b);
//String sql = "INSERT into photo_test (\"Photo\") values('" + b + "')";
//stmt.execute(sql);
//stmt.close();
//}/catch(Exception e)
//{
//System.out.println(e);
//}
//out.println("The Image is Added into Database");
     %>
  </body>
</html>
